package com.agua.enturno.vista.paginas.prestador;

import com.agua.enturno.vista.componentes.HorarioGUI;
import com.agua.enturno.vista.dto.HorarioDTO;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;

import java.util.List;

public class DiaDeAgendaGUI extends Panel {

	private static final long serialVersionUID = 1L;
	
	
	public DiaDeAgendaGUI(String id, IModel<List<HorarioDTO>> model) {
		super(id, model);
		this.setOutputMarkupId(true);
		
		add(new ListView<HorarioDTO>("horario", model) {

			private static final long serialVersionUID = 1L;

			@Override
			protected void populateItem(ListItem<HorarioDTO> item) {
				item.add(new HorarioGUI("horario-interno", new PropertyModel<HorarioDTO>(item, "modelObject")));
			}
			
		});
	}

}
